package io.sk.common.base;

/**
 * 基础controller
 *
 * @author King
 */
public class BaseController {

    private BaseResult baseResult;

    public BaseResult sendResult200() {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_200, Constants.RESPONSE_MESSAGE_200);
    }

    public BaseResult sendResult200(Object data) {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_200, Constants.RESPONSE_MESSAGE_200, data);
    }

    public BaseResult sendResult400() {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_400, Constants.RESPONSE_MESSAGE_400);
    }

    public BaseResult sendResult400(String message) {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_400, message);
    }

    public BaseResult sendResult430() {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_430, Constants.RESPONSE_MESSAGE_430);
    }

    public BaseResult sendResult430(Object data) {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_430, Constants.RESPONSE_MESSAGE_430, data);
    }

    public BaseResult sendResult431() {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_431, Constants.RESPONSE_MESSAGE_431);
    }

    public BaseResult sendResult431(Object data) {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_431, Constants.RESPONSE_MESSAGE_431, data);
    }

    public BaseResult sendResult500() {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_500, Constants.RESPONSE_MESSAGE_500);
    }

    public BaseResult sendResult602() {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_602, Constants.RESPONSE_MESSAGE_602);
    }

    public BaseResult sendResult602(String message) {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_602, message);
    }

    public BaseResult sendResult605() {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_605, Constants.RESPONSE_MESSAGE_605);
    }

    public BaseResult sendResult605(String message) {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_605, message);
    }

    public BaseResult sendResult500(Object data) {
        return baseResult = new BaseResult(Constants.RESPONSE_CODE_500, Constants.RESPONSE_MESSAGE_500, data);
    }

    public BaseResult sendResult(int code, String message) {
        return baseResult = new BaseResult(code, message);
    }

    public BaseResult sendResult(int code, String message, Object data) {
        return baseResult = new BaseResult(code, message, data);
    }

    public BaseResult getBaseResult() {
        return baseResult;
    }

    public void setBaseResult(BaseResult baseResult) {
        this.baseResult = baseResult;
    }
}
